﻿<Window x:Class="Northwind.UI.WPF.OrderWizard"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
        xmlns:local="clr-namespace:Northwind.UI.WPF"
        xmlns:AttachedBehaviors="clr-namespace:Northwind.UI.WPF.AttachedBehaviors"
        xmlns:viewModels="clr-namespace:Northwind.ViewModel;assembly=Northwind.ViewModel"
        Title="Order Wizard" Height="400" Width="650">
    <Window.Style>
        <Style>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsCloseView}" Value="true" >
                    <Setter Property="AttachedBehaviors:MainWindowAttachedBehaviors.IsCloseView" Value="true" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Style>
    <Window.DataContext>
        <viewModels:OrderWizardViewModel />
    </Window.DataContext>
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Skins/MainSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <local:OrderWizardCustomerView DataContext="{Binding CustomerDetails}" >
            <local:OrderWizardCustomerView.Visibility>
                <Binding RelativeSource="{RelativeSource AncestorType= Window}" 
                         Path="DataContext.CustomerViewVisibility" />
            </local:OrderWizardCustomerView.Visibility>
        </local:OrderWizardCustomerView>
        <!--                    Visibility="{Binding RelativeSource={RelativeSource AncestorType= Window}, Path=DataContext.CustomerViewVisibility}" />-->
        <local:OrderWizardEmployeeView DataContext="{Binding Employees}" 
                            Visibility="{Binding RelativeSource={RelativeSource AncestorType= Window}, Path=DataContext.EmployeeViewVisibility}" />
        <local:OrderWizardOrderDetailsView DataContext="{Binding OrderDetails}" 
                            Visibility="{Binding RelativeSource={RelativeSource AncestorType= Window}, Path=DataContext.OrderDetailsViewVisibility}" />
    </Grid>
</Window>
